/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sessionBeans;

import entityBeans.SubjectEntity;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author h08125
 */
@Local
public interface SubjectSessionBeanLocal {
    /**
     * get the top level subject (containing all the others as sons or son of son etc..)
     * @return top level subject
     */
    SubjectEntity getTopLevelSubject();
    /**
     * Get the subject defined by the id
     * @param myId
     * @return subject defined by the id
     */    
    public SubjectEntity getSubjectById(int myId);
    /**
     * Get the subject defined by the Uuid
     * @param myUuid
     * @return subject defined by the Uuid
     */
    SubjectEntity getSubjectByUuid(String myUuid);
    /**
     * Add a new subject in the DB
     * 2 ways to use this function
     * 1) fill the myFatherSubject argument, then it will be the father
     * 2) if myFatherSubject is null, it will look at mySonSubject.myFather.Uuid and extract that subject from the DB and add it as the father.
     * So fill the mySonSubject.myFather.Uuid with the subject you want as father
     * @param myFatherSubject
     * @param mySonSubject
     * @return true if it succeeded
     */
    boolean addSubject(SubjectEntity myFatherSubject,SubjectEntity mySonSubject);
    /**
     * Return the list of subjects as a tree like view
     * @param mySubject Subject from which we start to list
     * @param mySubjectList Empty list that will be filled by the function
     * @return list of subjects as a tree like view
     */
    ArrayList<SubjectEntity> getAdminRecursiveOrder(SubjectEntity mySubject,ArrayList<SubjectEntity> mySubjectList);
    /**
     * Method to modify a subject
     * In the case of a new father to put, it will update the different father sons lists etc...
     * and check if the father is legitimate (no thread and not the subject itself)
     * @param mySubject Subject to update
     */
    void modifySubject(SubjectEntity mySubject);
}
